package com.next

class WorkflowInstanceStage
{
    Integer executionSequence
    String name
    Boolean canReject = true
    WorkflowInstance instance

    OpportunityLayout desktopLayout
    //后台页面布局
    OpportunityLayout mobileLayout
    //h5布局
    OpportunityLayout wechatLayout
    //微信布局
    String type
    //访问类型

    Date startTime
    Date endTime
    Boolean processed = false

    //static belongsTo = [instance: WorkflowInstance]

    static hasMany = [conditions: WorkflowInstanceCondition, events: WorkflowInstanceEvent]

    static constraints = {
        executionSequence unique: ['instance'], min: 1, max: 10000
        name unique: ['instance'], maxSize: 32
        desktopLayout nullable: true, blank: true
        mobileLayout nullable: true, blank: true
        wechatLayout nullable: true, blank: true
        type nullable: true, blank: true, maxSize: 32
        type inList: ["private", "public"]
        startTime nullable: true, blank: true
        endTime nullable: true, blank: true
        processed nullable: true, blank: true
    }

    static mappedBy = [conditions: 'stage']
}
